package com.liner;

import java.util.Scanner;

public class ForDemo {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        //break
        boolean flag = true;

        System.out.println("欢迎来到新新超市");
        do {
            System.out.print("请选择业务(1.买入 2.卖出 3.退出系统):");
            int num = scanner.nextInt();
            switch (num) {
                case 1:
                    System.out.println("买入");
                    break;
                case 2:
                    System.out.println("卖出");
                    break;
                case 3:
                    System.out.println("退出系统");
                    flag = false;
                    break;
                default:
                    System.out.println("输入指令错误");
                    break;
            }

        } while (flag);

        System.out.println("_________________________");
        //continue
        System.out.println("我不想看到数字5:");
        for (int i = 0; i < 10; ) {
            i++;
            if (i == 5) {
                continue;
            }
            System.out.print(i + "\t");
        }
        System.out.println("\n~~~~~~~~~~~~~~~");
        for (int i = 0; i < 10; i++) {
            if (i != 5) {
                System.out.print(i + "\t");
            }

        }

    }
}
